package com.itdct.onflow.core.qo

import com.itdct.onflow.core.type.Page
import io.swagger.v3.oas.annotations.media.Schema
import jakarta.validation.constraints.Max
import jakarta.validation.constraints.Min
import jakarta.validation.constraints.NotNull
import java.util.*

/**
 * @author Zhouwx
 * @date 2025/7/20 14:58:57
 * @version 1.0
 * @description
 */
open class BasePageQo : BaseQo() {
    //列表相关
    @Schema(title = "页码PageNumber，仅在列表中使用", example = "1")
    @Min(value = 0, message = "页号必须大于等于0", groups = [Page::class])
    @NotNull(message = "请输入当前页", groups = [Page::class])
    var pageNum: Long? = null

    @Schema(title = "每页多少条，仅在列表中使用", example = "10")
    @Min(value = 0, message = "页面大小必须大于等于0", groups = [Page::class])
    @Max(value = 100, message = "页面大小不能超过100条", groups = [Page::class])
    @NotNull(message = "请输入每页大小", groups = [Page::class])
    var pageSize: Int? = null

    @Schema(title = "排序，仅在列表中使用", example = "create_time desc", hidden = true)
    var orderBy: String? = null

    @Schema(title = "sortBy某个字段，仅在列表中使用", example = "")
    var sortBy: String? = null

    @Schema(title = "sortOrder排序方式，仅在列表中使用", example = "")
    var sortOrder: String? = null

    @Schema(title = "开始时间，仅在列表中使用", example = "")
    var createTime: List<Date>? = null

    @Schema(title = "结束时间，仅在列表中使用", example = "")
    var updateTime: List<Date>? = null

    @Schema(title = "创建人", example = "")
    var createUser: Long? = null

    @Schema(title = "修改人", example = "")
    var updateUser: Long? = null
}